#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <sdktools>

public Plugin myinfo = 
{
	name = "l4d2_Instant_ghost_spawn",
	author = "豆瓣酱な",
	description = "特感可以在玩家面前重生.",
	version = PLUGIN_VERSION,
	url = "https://gitee.com/sweet-and-sour-bombs/adfvsdsd"
}

public void OnPlayerRunCmdPost(int client) {
    if (IsFakeClient(client) || GetClientTeam(client) != 3 || !IsPlayerAlive(client))
        return;

    if (GetEntProp(client, Prop_Send, "m_isGhost")) {
        if (GetEntProp(client, Prop_Send, "m_ghostSpawnState") != 384) {
            if (GetEntProp(client, Prop_Send, "m_ghostSpawnState") != 0) {
                SetEntProp(client, Prop_Send, "m_ghostSpawnState", 0);
            }
        }
    }
}
